<script>

show_aclrow();

<?php if ( !$this->xml):?>
$( "#tabs" ).tabs( { disabled: [1, 2] } );
<?php elseif (! $this->xml->param): ?>
$( "#tabs" ).tabs( { disabled: [1] } );
<?php else:?>
$("#tabs").tabs();
<?php endif;?>


$('#setAccess').ajaxForm(function(data) {
	if (data == 'reload') {
		location.reload();
	}
	else if (data >0){
		$("#title-"+data).html ($("#title").attr('value'));
       $("#system-message").html('<?php echo $this->translate("save completed")?>').show().fadeOut('show');
      aclset(sel_id); // 重新顯示授權資料
      }
	else {
		alert('<?php echo $this->translate("double set")?>');
	}
	});

//授權資料
function aclset(id) {

	$.get("<?php echo $this->baseScript?>/getaclaccess/id/"+id ,
		function(data){
			$("#permList").html(data);
			show_aclrow();
	}
	);
}

function show_aclrow(){
	$("#permList tbody tr").removeClass();
	$("#permList tbody tr:even").addClass('even');
	$("#permList tbody tr:odd").addClass('odd');
	$("#permList span.delacl").css({'cursor': 'pointer','background-color':'#f6f','color':'#fff','padding':'0 2px'});
}

//刪除權限
function delacl(id) {
	$.getJSON("<?php echo $this->baseScript?>/delaccess/id/"+id ,
		function(data) {
			$("#d-"+data).parent().parent().remove();
		}
	);
	show_aclrow();
  }

</script>
<div id="tabs" style="font-size: 13px">
	<ul>
		<li><a href="#tabs-1"><?php echo  $this->translate('module-set')?></a></li>
		<li><a href="#tabs-2"><?php echo  $this->translate('module-variable')?></a></li>
		<li><a href="#tabs-3"><?php echo  $this->translate('module-upgrade')?></a></li>
	</ul>
<div id="tabs-1">

<?php echo $this->render('manager/module-set.phtml')?>
</div>
<div id="tabs-2">
<?php echo $this->render('manager/module-params.phtml')?>
</div>
<div id="tabs-3">
升級
</div>
</div>